<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>HTML5最佳实践:Canvas还是SVG</title>
	</head>
	<body>
		<i>HTML5绘制的一个矩形</i>

		<canvas id="myCanvas" width="300" height="200">
		  你的浏览器不支持Canvas
		</canvas>
		
		<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="190">
		  <polygon points="100,10 40,180 190,60 10,60 160,180"
		  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
		</svg>
		
		<script>
			var canvas = document.getElementById("myCanvas");
			var ctx = canvas.getContext('2d');
			ctx.fillStyle = 'red';
			ctx.fillRect(10,10,300,250);
		</script>
	</body>
</html>
